home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
3dlib30b.zip
/
DEMO3D.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1994-03-10
|
2KB
|
80 lines
// demo3d.cpp
#include "rtobj.h"
#include <graphics.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <conio.h>
int main();
int i, element;
unsigned int ee;
baseObjectPtr obj[9];
char ch;
double v0, v1, v2, v3, v4, v5, v6, v7, v8, v9;
int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
/******************************************************************************
* error *
******************************************************************************/
void error(unsigned short int i, unsigned int j)
{
char errStr[21];
char a;
restorecrtmode();
switch (i) {
case 1 : {
strcpy(errStr, "I/O error #");
break;
} // case 1
default : {
strcpy(errStr, "General error #");
break;
} // default
} // switch i
printf("\n%s\n", errStr);
if (!j)
printf("%u\n", j);
else
printf("\n");
closegraph();
abort();
} /* error */
/******************************************************************************
* power *
******************************************************************************/
double power(double a, double b)
{
return pow(a, b);
} /* power */
/******************************************************************************
* main *
******************************************************************************/
int main()
{
int i = 0;
startGraph();
outtextxy(80, 10, "3dLib demo program, (c) 1994, HyperAct, Inc.");
resetPerspective();
obj[1] = new obj3d("pyr.3d3", zeroPoint, maxColor);
obj[1]->load();
obj[1]->goto3dPos(0, 0, 0);
for (i0 = 1; i0 <= 15; i0++) {
setcolor(1 + random(maxColor));
obj[1]->paint();
obj[1]->rotate(z, 12);
} // for i0
do {
i = kbhit();
} while (!i);
closegraph();
return 0;
} /* main */